package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.devicecontroller.messageprocessors.RequestProcessorImp;

import net.wimpi.modbus.msg.ExceptionResponse;
import net.wimpi.modbus.msg.ModbusRequest;
import net.wimpi.modbus.msg.ModbusResponse;
import net.wimpi.modbus.msg.ModbusUtil;

public class ErrorRequestProcessor extends AbstractRequestProcessor {

	@Override
	public ModbusResponse processRequest(ModbusRequest req) {
		ExceptionResponse res;
		res = new ExceptionResponse(req.getFunctionCode(), 1);
		ModbusUtil.setMessageData(res, req);
		return res;
	}

}
